SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 38580: Calling a stored procedure with a null parameter in SAS/ACCESS® Interface to DB2 might result in a -804 DB2 error

DetailsHotfixAboutRate It

For SAS/ACCESS Interface to DB2 in the z/OS operating environment, an error similar to the following might occur upon invocation of a stored procedure.

DB2 execute error DSNT408I SQLCODE = -804, ERROR:  AN ERROR WAS
FOUND IN THE APPLICATION PROGRAM INPUT PARAMETERS FOR THE SQL 
STATEMENT, REASON 09

The error occurs when you call the stored procedure and you use a null parameter, as shown in the following SQL procedure:

proc sql; connect to db2(ssid=db2p); select * from connection to db2(call SAS.SASPROC('')); quit;

This error occurs because of a change that IBM made to DB2 9 in which a character that is an empty string now results in an error. This error does not not occur with DB2 Version 8.

The workaround is to specify the null parameter with a macro and then reference the macro in the invocation, as shown in the following example:

%let p=''; proc sql; connect to db2(ssid=db2p); select * from connection to db2(call SAS.SASPROC(:p)); quit;

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to DB2z/OS9.1 TS1M3 SP49.3 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.